package com.tianhai.db.parser.ast;

/**
 * DELETE语句AST节点
 */
public class DeleteStatement extends Statement {
    
    private final String tableName;
    private final SelectStatement.WhereClause whereClause;
    
    public DeleteStatement(String tableName, SelectStatement.WhereClause whereClause) {
        this.tableName = tableName;
        this.whereClause = whereClause;
    }
    
    @Override
    public StatementType getType() {
        return StatementType.DELETE;
    }
    
    public String getTableName() {
        return tableName;
    }
    
    public SelectStatement.WhereClause getWhereClause() {
        return whereClause;
    }
    
    @Override
    public String toString() {
        return "DeleteStatement{" +
                "tableName='" + tableName + '\'' +
                ", whereClause=" + whereClause +
                '}';
    }
}
